<?php
/**
 * This is Area controller test file. 
 *
 * @copyright     Copyright 2008-2010, LilCake.net
 * @link          http://lilcake.net LilCake.net
 * @package       lil
 * @subpackage    lil.tests.cases.models
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
App::import('Model', 'Lil.Area');
/**
 * AreaTestCase class
 *
 * @uses          CakeTestCase
 * @package       lil
 * @subpackage    lil.tests.cases.models
 */
class AreaTestCase extends CakeTestCase {
/**
 * Blog property
 *
 * @var object
 * @access public
 */
	var $Area = null;
/**
 * fixtures property
 *
 * @var array
 * @access public
 */
	var $fixtures = array(
		'plugin.lil.area', 'plugin.lil.areas_user', 'plugin.lil.user',
	);
/**
 * start method
 *
 * @access public
 * @return void
 */
	function start() {
		// reset variables
		require dirname(dirname(dirname(dirname(__FILE__)))) . DS . 'config' . DS . 'core.php';
		
		parent::start();
		$this->Area =& ClassRegistry::init('Area');
	}
/**
 * testBlogInstance method
 *
 * @access public
 * @return void
 */
	function testAreaInstance() {
		$this->assertTrue(is_a($this->Area, 'Area'));
	}
/**
 * testBlogFind method
 *
 * @access public
 * @return void
 */
	function testAreaind() {
		$results = $this->Area->recursive = -1;
		$results = $this->Area->find('first');
		$this->assertTrue(!empty($results));

		$expected = array('Area' => array(
			'id'          => 1,
			'name'        => 'My First Area',
			Configure::read('Lil.areaSlugField')  => 'first',
			'description' => 'This is my first area.',
			'theme'       => null,
			'created'     => '2008-01-23 12:34:56',
			'modified'    => '2008-03-21 12:34:56'
		));
		$this->assertEqual($results, $expected);
	}
}
?>